<?php namespace Summer\Slideshow\Updates;

use Schema;
use Winter\Storm\Database\Updates\Migration;

class BuilderTableCreateSummerSlideshowSlides extends Migration
{
    public function up()
    {
        Schema::create('summer_slideshow_slides', function($table)
        {
            $table->engine = 'InnoDB';
            $table->increments('id')->unsigned();
            $table->timestamp('created_at')->nullable();
            $table->timestamp('updated_at')->nullable();
            $table->string('name')->nullable();
            $table->text('description')->nullable();
            $table->string('link', 255)->nullable();
            $table->integer('sort_order')->nullable();
            $table->integer('status')->nullable()->default(1);
            $table->integer('slideshow_id')->unsigned();
            $table->foreign('slideshow_id')->references('id')->on('summer_slideshow_slideshows')->onUpdate('cascade')->onDelete('cascade');
        });
    }
    
    public function down()
    {
        Schema::dropIfExists('summer_slideshow_slides');
    }
}
